< previous page page_28 next page >

Page 28
tip.gif
Instead of Ctrl+clicking multiple controls, you can select a group of controls by drawing a rectangle around them. Click and hold down the left mouse button in an empty area of the form. Note that a "rubber-band" box stretches as you move the mouse. Draw the box around all the controls you want to select.

Labeling Your Program's Controls
Obviously, the user needs to know which values are to be entered into each of the text boxes. The easiest way to do this is to add a Label control next to each text box. The label will then act as a caption for the text box, containing a brief description of what data is to be entered there.
Although the user perceives Label controls and TextBox controls to be quite different, they are very similar from a programmer's perspective. They can both contain the same types of text, although the text in a Label control can't be modified by the user. However, by setting various properties of a Label control, the appearance of the text contained in it can be altered in many ways. Figure 2.13 illustrates several Label controls demonstrating a variety of looks.
0028-01.jpg
Figure 2.13
Labels can take on many
different sizes and appearances.
To continue your earlier analogy of a survey form, Label controls are like the words that are pre-printed on the form to identify the purpose of the text boxes. The key difference between a Label control and a TextBox control is that a Label control contains text that the user cannot change. The text contained in a Label control is stored in its Caption property (as opposed to a TextBox control's Text property).
To add a Label control to a form, follow these steps:
lcontrols.gif1. Select the Label control's tool in the Toolbox.
2. Draw a Label control to the left of the first TextBox control.
3. In the Properties window, change the Label control's Name property to lblPrincipal.
4. Change the Label control's Caption property to Principal:.
5. Change the Label control's Alignment property to 1 - Right Justify, using the drop-down arrow next to the property setting (see Figure 2.14). This makes the label align its caption along the right side, next to its corresponding text box, as is common with caption labels.

 
< previous page page_28 next page >